<%-- 
    Document   : orderfoodadmin
    Created on : May 2, 2012, 6:18:21 PM
    Author     : Luong
--%>

<%@page import="entities.OderFood"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript" src="paging/jquery-1-3-2.js"></script>
<script type="text/javascript" src="paging/tablesorter.js"></script>
<script type="text/javascript" src="paging/tablesorter_filter.js"></script>
<script type="text/javascript" src="paging/jquery.tablesorter.pager.js"></script>
<%@taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Tunga Restaurant</title>
        <link href="style_admin.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript">
            function checkdelete(){
                return confirm("Are you sure ?");
            }
        </script>
    </head>
    <body>
        <center>
            <c:set var="session" value="${sessionScope.user}"/>
            <c:if test="${empty session}">
                <script>
                    function h()
                    {
                        window.location="index.jsp"
                    }
                </script>
            </c:if>
            <div class="outer">
                <!--Header end-->
                <div id="rc1"></div>
                <div id="bg">
                    <div class="toplinks"><a href="ContactUs.jsp">Contact us</a></div><div class="sap">|</div>
                    <div class="toplinks"><a href="initShowFood?action=Food">Food</a></div><div class="sap">|</div>
                    <div class="toplinks"><a href="ControllerTables?action=Table">Table</a></div><div class="sap">|</div>
                    <div class="toplinks"><a href="ControllerRooms?action=Room">Room</a></div><div class="sap">|</div>
                    <c:if test="${empty session}">
                        <div class="toplinks"><a href="registration.jsp">Register</a></div><div class="sap">|</div>
                        <div class="toplinks"><a href="login.jsp">Login</a></div><div class="sap">|</div>
                    </c:if>
                    <div class="toplinks"><a href="index.jsp">Home Page</a></div>
                    <div><font color="white">Welcome, </font><font color="yellow">${sessionScope.user}</font> </div>
                    <div>
                        <font color="yellow"><a href="ControllerCustomer?action=Information&user=${sessionScope.user}">Your information</a></font>
                        <%
                                    if (session.getAttribute("isadmin") != null) {
                        %>
                        <a href="index_admin.jsp">Admin Manager</a>
                        <%                                    }
                        %>
                        <font color="yellow">
                            <c:url var="LogOut" value="ControllerCustomer">
                                <c:param name="action" value="LogOut"/>
                            </c:url>
                            <a href="${LogOut}">LogOut</a>
                        </font>
                    </div>
                </div>
                <div id="rc2"></div>
                <div id="header">
                    <div class="name">Tunga Restaurant Admin Manager</div>
                    <div class="tag">The best restaurant in the world</div>
                </div>
                <!--Top nav end-->
                <div style="clear:left"></div>
                <div id="outer2">
                    <div id="left-nav">
                        <div class="leftlinks">
                            <span class="heading">Manage</span>
                            <ul>
                                <li><a href="ControllerCustomer?action=Customer">Customer</a></li>
                                <li><a href="ControllerFood?action=adminFood">Food</a></li>
                                <li><a href="ControllerAdminRooms?action=AdminRooms">Room</a></li>
                                <li><a href="ControllerTables?action=AdminTables">Table</a></li>
                                <li><a href="ControllerOrderFood?action=adminOrderFood">Order Food</a></li>
                                <li><a href="ControllerAdminBookRooms?action=AdminBookRooms">Book Room</a></li>
                                <li><a href="ControllerTables?action=AdminBookTables">Book Table</a></li>
                                <li><a href="report.jsp">Report</a></li>
                            </ul>
                        </div>
                    </div><div class="inner_copy"><div class="inner_copy">All <a href="http://www.magentothemesworld.com" title="Best Magento Templates">premium Magento themes</a> at Magentothemesworld.com!</div></div>
                    <div id="content" align="center">
                        <span class="heading">Manage OrderFood </span>
                        <div id="main">
                            <%
                                        List<OderFood> listOrder = (List) request.getAttribute("listOrderFoodAdmin");
                                        int j = 0;
                            %>
                            <h1>List Order Food</h1>
                            <form action="ControllerOrderFood" method="POST" >
                                <table border="0" class="subtable tablesorter" id="myTable">
                                    <thead>
                                        <tr>
                                            <th></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <th>No</th>
                                    <th>Customer</th>
                                    <th>DateTime</th>
                                    <th>Price</th>
                                    <th>Cancel</th>
                                    <th>Details</th>
                                    <%
                                                for (int i = 0; i < listOrder.size(); i++) {
                                                    j++;
                                    %>
                                    <input type="hidden" name="txtorderid" value="${rows.oderFoodID}"/>
                                    <tr>
                                        <td><%= j%></td>
                                        <td><%= listOrder.get(i).getCustomers().getCustID()%></td>
                                        <td><%= listOrder.get(i).getDateTime()%></td>
                                        <td><%= listOrder.get(i).getTotalPrice()%></td>
                                        <td>
                                            <%
                                                                                                if (listOrder.get(i).getStatus()) {
                                            %>
                                            <input type="checkbox" name="chkStatus" value="<%= listOrder.get(i).getOderFoodID()%>" checked/>
                                            <%                                                    } else {
                                            %>
                                            <input type="checkbox" name="chkStatus" value="<%= listOrder.get(i).getOderFoodID()%>"/>
                                            <%                                                                                                }
                                            %>
                                        <td>
                                            <a href="ControllerOrderFood?action=DetailOder&orid=<%= listOrder.get(i).getOderFoodID()%>">Details</a>
                                        </td>
                                    </tr>
                                    <%                                                }
                                    %>
                                </table>
                                <td><input type="submit" name="action" value="Update"/></td>
                            </form>
                            <div id="pager" align="center">
                                <form>
                                    <input type="button" value="<<" class="first"/>
                                    <input type="button" value="<" class="prev"/>
                                    <input type="text"  class="pagedisplay"/>
                                    <input type="button" value=">" class="next"/>
                                    <input type="button" value=">>" class="last"/>
                                    <select class="pagesize">
                                        <option selected="selected" value="10">10</option>
                                        <option value="20">20</option>
                                    </select>
                                </form>
                            </div>
                            <br>
                            <br>
                        </div>
                    </div>
                    <div style="clear:left"></div>
                </div>
                <!--Bottom part-->
                <div id="bottom">
                    <div id="footer"><div class="fcenter">GROUP02-F5-10-1009-S1</div></div>
                </div>
            </div>
        </center>
    </body>
</html>
<script type="text/javascript">
    jQuery(document).ready(function(){
        $("#myTable")
        .tablesorter({widgets:['zebra']})
        .tablesorterPager({container:$("#pager"),size:10});
        //.tablesorterFilter({filterContainer:$("#filter-box"),
        //     filterClearContainer:("#filter-clear-button"),
        //    filterColumns:[0],
        //     filterCaseSensitive:false });

    });
</script>